home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12519 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.primenet.com!not-for-mail
  2. From: bking@primenet.com (Brien King)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: Calling all API experts !!
  5. Date: 19 Mar 1996 23:28:02 -0700
  6. Organization: Primenet Services for the Internet
  7. Sender: root@primenet.com
  8. Message-ID: <314fa69d.8181856@news>
  9. References: <DoIMG1.F9y@unx.sas.com>
  10. X-Posted-By: ip098.phx.primenet.com
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. On Tue, 19 Mar 1996 12:52:49 GMT, sdkkah@mvs.sas.com wrote:
  14.  
  15. >
  16. >Hi, world
  17. >
  18. >I am trying to make an application with a tool which just recently allowed
  19. >calling Windows API's. The tool (The SAS System) itself is written in C++.
  20. >Some API's works OK, but there's one I cant figure out how to use right.
  21. >Its called GetProfileString. I need to access the [fonts] section of WIN.INI,
  22. >and get all entries and values. But I dont know the number of entries to
  23. >read, since this obviously varies. Is there some kind of trick that would
  24. >allow me to loop through untill the last entry is read, without having to
  25. >know the exact number of entries in each section ? 
  26. >
  27. >Getting the font names is just getting me half the way. I also need to
  28. >know the point size and property (Bold,Italic etc..). Does anyone know
  29. >where I can get this information ?
  30. >
  31. >Finally, can anyone recommend any good documentations as to how
  32. >Windows API's are dealt with in general ?
  33. >
  34. >All kind of help is appreciated.
  35. >
  36. You can skip the API when it comes to reading INI files.  Use the
  37. TIniFile object, it has a method called "ReadSection", this will read
  38. all keys into a TStringList then you can loop through each element in
  39. the list and read the values associated with the key with the
  40. ReadString method of the TIniFile.  Once you have built the list of
  41. fonts, you can use the API function GetTextMetrics which will return a
  42. lot of (if not all) the information you need.
  43.  
  44.  
  45.